<?php
// Luu ten style hien thoi
$v_current_style_name = "odd_row";
$v_next_style_name = "round_row";
// So linh vuc co cau hoi cua tat ca cac co quan hanh chinh
$v_count = sizeof($arr_all_qa_by_all_agency);
$v_url_send_question = "index.php?fuseaction=DISPLAY_SINGLE_QA_QUESTION_FOR_SENDING";
?>
<!--bang chua tieu de cua form-->
<table width="100%" cellpadding="0" cellspacing="0">
	<tr class="page_title">
		<td><?php echo CONST_QA_LIST_ALL_AGENCY_TITLE; ?></td>
	</tr>
	<tr> 
		<td class="send_qa_link">
			<a href="<?php echo $v_url_send_question;?>"><?php echo CONST_QA_QUESTION_FOR_ANSWER_TITLE;?></a>
			<img src="<?php echo $_ISA_IMAGE_URL_PATH?>send_qa.gif">
		</td>
	</tr>	
</table>
<table width="100%" cellpadding="0" cellspacing="0"><?php
	if ($v_count >0){
		$row_index = 0;
		$v_old_agency_id = 0;
		while($row_index < $v_count){
			$v_cate_id = $arr_all_qa_by_all_agency[$row_index]['0'];
			$v_agency_id = $arr_all_qa_by_all_agency[$row_index]['1'];
			$v_cate_name = $arr_all_qa_by_all_agency[$row_index]['2'];
			$v_agency_name = $arr_all_qa_by_all_agency[$row_index]['3'];
			$v_number_qa_of_cate = $arr_all_qa_by_all_agency[$row_index]['4'];
			$v_number_qa_of_agency = $arr_all_qa_by_all_agency[$row_index]['5'];
			
			$v_agency_url = "index.php?fuseaction=DISPLAY_ALL_CATE_BY_AGENCY&agency_id=".$v_agency_id."&cate_id=".$v_cate_id;
			$v_cate_url = "index.php?fuseaction=DISPLAY_ALL_QA_BY_CATE&cate_id=".$v_cate_id."&agency_id=".$v_agency_id;
			if ($v_current_style_name == "odd_row"){
				$v_current_style_name = "round_row";
			}else{
				$v_current_style_name = "odd_row";
			}
			if($v_old_agency_id!=$v_agency_id){ ?>	
				<tr><td height="5pt"></td></tr>
				<tr class="agency_link"> 
					<td align="left">
						<a href="<?php echo $v_agency_url; ?>" class="agency_link"><?php echo $v_agency_name; ?>&nbsp;</a><small class="number_label"><?php echo "(&nbsp;".$v_number_qa_of_agency."&nbsp;)";?></small>
					</td>
				</tr><?php
			}?>
			<tr class="cate_on_list_page">
				<td align="left">
					<a class="cate_on_list_page" href="<?php echo $v_cate_url; ?>"><?php echo $v_cate_name; ?>&nbsp;</a><small class="number_label"><?php echo "(&nbsp;".$v_number_qa_of_cate."&nbsp;)";?></small>
				</td>
			</tr><?php 
			$v_old_agency_id = $v_agency_id;
			$row_index++ ; 
		}	
	}else{ ?>
		<tr>
			<td class="normal_label"><?php //echo CONST_QA_EMPTY_AGENCY_LABEL;?></td>
		</tr><?php
	}?>
</table>
	
